package com.sep.modules.sys.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sep.common.constant.SepConstant;
import com.sep.common.entity.QueryRequest;
import com.sep.common.utils.SortUtil;
import com.sep.modules.sys.entity.User;
import com.sep.modules.sys.mapper.UserMapper;
import com.sep.modules.sys.service.UserService;
import org.springframework.stereotype.Service;

/**
*
* @author 路人甲
* @since 2021-05-11
*/
@Service
public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements UserService {



    @Override
    public IPage<User> findUserDetail(User user, QueryRequest request) {
        try {
            Page<User> page = new Page<>();
            SortUtil.handlePageSort(request, page, "userId", SepConstant.ORDER_ASC, false);
            return this.baseMapper.findUserDetail(page, user);
        } catch (Exception e) {
            log.error("查询用户异常", e);
            return null;
        }
    }

    @Override
    public void createUser(User user) throws Exception {

    }

    @Override
    public void updateUser(User user) throws Exception {

    }

    @Override
    public void deleteUsers(String[] userIds) throws Exception {

    }
}
